﻿using SverigesRadio.SverigesRadioApp.Business.Model;

namespace SverigesRadio.SverigesRadioApp.WindowsPhoneApplication.ViewModels.Channels
{
    public class ChannelInformationViewModel
    {
        private readonly Channel channel;

        public ChannelInformationViewModel(Channel channel)
        {
            this.channel = channel;
        }

        public string Id
        {
            get { return channel.Id; }
        }

        public string Name
        {
            get { return channel.Name; }
        }


        public string Colour
        {
            get { return channel.Colour; }
        }

        public string FormattedColour
        {
            get { return string.Format("#{0}", Colour); }
        }

        public string CurrentProgramTitle { get; private set; }

        public string NextProgramUrl { get; private set; }

        public string ProgramUrl { get; private set; }

        public string NextProgramStopTime { get; private set; }

        public string NextProgramStartTime { get; private set; }

        public string NextProgramTitle { get; private set; }

        public string CurrentProgramInfo { get; private set; }


        public void AddBroadcastData(BroadcastInfoChannel broadcastInfoChannel)
        {
            CurrentProgramTitle = broadcastInfoChannel.ProgramTitle;
            CurrentProgramInfo = broadcastInfoChannel.ProgramInfo;
            NextProgramTitle = broadcastInfoChannel.NextProgramTitle;
            NextProgramStartTime = broadcastInfoChannel.NextProgramStartTime;
            NextProgramStopTime = broadcastInfoChannel.NextProgramStartTime;
            ProgramUrl = broadcastInfoChannel.ProgramURL;
            NextProgramUrl = broadcastInfoChannel.NextProgramURL;
        }

    }
}
